package com.itboye.ihomebank.responsitory;

import android.util.Log;

import com.google.gson.reflect.TypeToken;
import com.itboye.ihomebank.base.BaseNetRepository;
import com.itboye.ihomebank.base.ICompleteListener;
import com.itboye.ihomebank.base.MyApplcation;
import com.itboye.ihomebank.base.SystemMessBean;
import com.itboye.ihomebank.bean.AgentCenterBean;
import com.itboye.ihomebank.bean.ApplyStageBean;
import com.itboye.ihomebank.bean.BindCardsList;
import com.itboye.ihomebank.bean.ConfigBean;
import com.itboye.ihomebank.bean.DownKeyBean;
import com.itboye.ihomebank.bean.GuanLiPassBean;
import com.itboye.ihomebank.bean.HeTongBean;
import com.itboye.ihomebank.bean.ICCardListBean;
import com.itboye.ihomebank.bean.KaiSuoJiLu;
import com.itboye.ihomebank.bean.KeyOfLockBean;
import com.itboye.ihomebank.bean.KeysBean;
import com.itboye.ihomebank.bean.LunBoBean;
import com.itboye.ihomebank.bean.MyCollectionBean;
import com.itboye.ihomebank.bean.MyWalletBean;
import com.itboye.ihomebank.bean.NewDeviceLoginBean;
import com.itboye.ihomebank.bean.OpenIdBean;
import com.itboye.ihomebank.bean.PayInfo;
import com.itboye.ihomebank.bean.PersonDataBean;
import com.itboye.ihomebank.bean.QianYueDetailBean;
import com.itboye.ihomebank.bean.RegisterBean;
import com.itboye.ihomebank.bean.RentingBillBean;
import com.itboye.ihomebank.bean.RongFengsBean;
import com.itboye.ihomebank.bean.SIDBean;
import com.itboye.ihomebank.bean.ZhiMaBean;
import com.itboye.ihomebank.bean.ZouShiBean;
import com.itboye.ihomebank.constants.SPContants;
import com.itboye.ihomebank.interfaces.IUserInterface;
import com.itboye.ihomebank.net.BaseErrorListener;
import com.itboye.ihomebank.net.BaseSuccessReqListener;
import com.itboye.ihomebank.net.ByJsonRequest.Builder;
import com.itboye.ihomebank.util.SPUtils;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/***
 * 请求网络类
 * 
 * @author admin
 * 
 */
public class UserRepository extends BaseNetRepository implements
		IUserInterface<PersonDataBean> {
	String api = "100";
	String loginTypeKey = "BY_User_login";// 用户登录
	String sendTypeKey = "BY_Message_send_sms";// 发送短信
	String verificationTypeKey = "BY_Message_checkCode";// 验证验证码
	String registerTypeKey = "BY_User_register";// 注册
	String backPassTypeKey = "BY_User_findPswByMobile";// 手机找回密码
	String updateTypeKey = "BY_User_update";// 更新用户信息
	String UploadPicturesTypeKey = "BY_File_upload";// 图片上传
	String systemMessage = "BY_Message_query";// 获取系统消息
	String UpdatePwdByPwd = "BY_User_updatePsw";// 修改密码（通过原密码修改）
	String FindPwdByPhone = "BY_User_findPswByMobile";// 找回密码（通过手机号码找回）
	String oritation = "BY_Config_position";// 获取方向
	String house_addKey = "BY_House_add";// 发布房源
	String renzhengKey = "BY_User_verifyApply";// 实名认证
	String messageKey = "BY_Message_query";// 消息分页查询
	String bindKeJiXia = "BY_Sciener_reg";// 绑定科技侠

	String heTongParams = "BY_Contract_getParams";// 获取填写合同参数

//	String heTongParamsNew  = ""; //
	String tiJiaoHeTong = "BY_Contract_write";// 提交合同20
	String queRenHeTong = "BY_Contract_confirm";// 确认合同
	String orderDetail = "BY_Contract_detail";// 订单详情
	String myCollection = "BY_favorites_show";// 我的收藏
	String getYwHistory = "BY_Message_ywHis";// 获取历史
	String siliao = "BY_Message_ywPush";// 私聊
	String ywContactName = "BY_Message_ywRelation";// 获取联系人列表
	String payHouse = "BY_Pay_payInfo";// 预支付

	String zhiFuPass = "BY_Wallet_updatePsw";// 支付密码
	String zhiFuPassYanZheng = "BY_Wallet_checkPsw";// 验证支付密码

	String myWallet = "BY_wallet_balance";// 我的钱包
	String updateWalletPws = "BY_Wallet_updatePsw";// 修改支付密码
	String walletCheckPsw = "BY_Wallet_checkPsw";// 验证支付密码
	String WalletBindBankCard = "BY_Wallet_bindBankCard";// 绑定银行卡

	String WalletUnBindBankCard = "BY_Wallet_deleteBankCard";// 解除绑定银行卡
	String bankType = "BY_Wallet_getBank";// 获取银行卡的类型
	String bankList = "BY_Wallet_bankCardList";// 已绑定银行卡列表
	String tixian = "BY_Wallet_withdraw";// 申请提现
	String lunbo = "BY_File_banner";// 轮播
	String yanzhengrf = "BY_pay_rfpaySendSms";//
	String yzyue = "BY_Wallet_checkPsw";// 验证余额密码
	String zoushi = "BY_house_communityRateChart";// 小区价格走势
	String queryUserByPhone = "BY_User_infoByMobile";// 通过手机得到账户
	String zhuanzhang = "BY_Wallet_transfer";// 转账
	String personData = "BY_User_info";// 获取个人数据
	String by_pay_rfpay = "BY_Pay_rfpay";// 发起rf支付

	String qingdan = "BY_Contract_confirmFacility";//确认资产清单

	String zhima_xinyong = "BY_Zhima_certify";//芝麻信用
	String zhima_xinyong_save = "BY_Zhima_saveScore";//芝麻信用  存入后台

	String loginByNewDevice = "BY_User_deviceLogin";
	String verifyBySms = "BY_User_deviceLoginSms";
    String rentingbill = "BY_Wallet_houseBill";
    String agent_center = "BY_User_brokerAssetMini";//经纪人个人中心
    String apply_stage = "BY_Contract_applyBankStage";//申请分期

	String shouquan = "BY_Sciener_auth";// 授权新用户
	String uploadJiLu = "BY_ScienerV3_unlock";// 上传开锁记录(v3)
	String uploadDian = "BY_ScienerV3_lowPower";// 电量过低(v3)
	String myKey = "BY_Sciener2_listUserKey";// 查询我的钥匙(v3)  ---已改
	String updateKey = "BY_ScienerV3_edit";// 修改钥匙名字(v3)
	String openid = "BY_ScienerV3_getOpenId";// 获取科技侠的openid
	String sendKey = "BY_ScienerV3_sendKey";// 发送钥匙(v3)
	String sendPwd = "BY_Sciener_getKeyboardPwd";// 发送密码
	String kaiSuoJiLu = "BY_Sciener_listRecord";// 开锁记录
	String keyOfLock = "BY_ScienerV3_listKey";// 锁的钥匙列表(v3)
	String passJiLu = "BY_ScienerV3_listKeyboardLog";//键盘密码记录(v3)
	String deletePass = "BY_Sciener_resetAllKey";//重置普通钥匙

	String deleteKey = "BY_Sciener_deleteKey";// 用户删除钥匙
	String unbindAdmin = "BY_ScienerV3_deleteKey";// 解绑管理员(v3)
	String downKey = "BY_Sciener_downKey";// 下载钥匙
	String lockKey = "BY_Sciener_lockKey";// 冻结钥匙
	String unlockKey = "BY_Sciener_unlockKey";// 解冻钥匙

	String safetyPay="BY_Pay_paPay";//发起平安支付

	String icList="BY_ScienerV3_listIcCards";//科技侠 ic卡列表
	String addICCard="BY_ScienerV3_addIcCard";//添加 ic卡
	String deleteICCard="BY_ScienerV3_delIcCard";//删除ic卡
	String clearICCardList="BY_ScienerV3_clearIcCard";//删除ic卡
	String changeAdminator= "BY_Sciener2_changeAdmin";//修改管理员
	public UserRepository(ICompleteListener iCompleteListener) {

		super(iCompleteListener);
	}

	@Override
	public void getSid(String userName, String pwd) {
		Type type = new TypeToken<SIDBean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
//		SPUtils.put(MyApplcation.ctx,null,SPContants.LOCK_SESSION,"DAF");
		map.put("username", userName);
		map.put("password", pwd);
		(new Builder<SIDBean>(true))
				.setTypeVerParamsAndReturnClass(loginTypeKey, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<SIDBean>(
								getListener(),true))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

	@Override
	public void login(String userName, String pwd) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<PersonDataBean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("username", userName);
		map.put("password", pwd);
		(new Builder<PersonDataBean>())
				.setTypeVerParamsAndReturnClass(loginTypeKey, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<PersonDataBean>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	/**
	 * 发送短信
	 */
	@Override
	public void send(String phone, String code) {
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("mobile", phone);
		map.put("code_type", code);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(sendTypeKey, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

	/**
	 * 验证验证码
	 */
	@Override
	public void verification(String mobile, String code_type, String code) {
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("mobile", mobile);
		map.put("code_type", code_type);
		map.put("code", code);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(verificationTypeKey, apiVer,
						map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

	/**
	 * 注册
	 */
	@Override
	public void register(String reg_type, String from, String code,
			String username, String password) {
		Type type = new TypeToken<RegisterBean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("reg_type", reg_type);
		map.put("from", from);
		map.put("code", code);
		map.put("username", username);
		map.put("password", password);
		(new Builder<RegisterBean>())
				.setTypeVerParamsAndReturnClass(registerTypeKey, apiVer, map,
						type)
				.requestListener(
						new BaseSuccessReqListener<RegisterBean>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

	/**
	 * 手机找回密码
	 */
	@Override
	public void backPass(String mobile, String code, String psw) {
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("mobile", mobile);
		map.put("code", code);
		map.put("psw", psw);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(backPassTypeKey, apiVer, map,
						type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}
	/**
	 * 手机找回密码
	 */
	@Override
	public void backPass(String mobile,String psw) {
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("mobile", mobile);
		map.put("psw", psw);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(backPassTypeKey, apiVer, map,
						type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

	@Override
	public void updateInfo(String uid, String realname, String email, String birthday, String nickname, String sex, String qq, String sign) {
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();

		map.put("uid", uid);
//		map.put("realname",realname);
//		map.put("email", email);
//		map.put("birthday",birthday);
		map.put("nickname", nickname);
		map.put("sex", sex);
//		map.put("qq",qq);
//		map.put("sign", sign);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(updateTypeKey, apiVer, map,
						type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

public void addMap(Map<String ,Object> map,String str){
	if (!str.equals("")&&str!=null){
		map.put(str,str);
	}
}
	/**
	 * 修改性别
	 */
	@Override
	public void updateSex(String uid, String sex) {
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("sex", sex);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(updateTypeKey, apiVer, map,
						type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

	/**
	 * 修改昵称
	 */
	@Override
	public void updateNickname(String uid, String nickname) {
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("nickname", nickname);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(updateTypeKey, apiVer, map,
						type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

	/**
	 * 修改头像
	 */
	@Override
	public void updateHead(String uid, String type, String image) {
		Type type01 = new TypeToken<String>() {
		}.getType();

		String apiver = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("type", type);
		map.put("image", image);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(UploadPicturesTypeKey, apiver,
						map, type01)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

	/***
	 * 得到系统配置
	 */
	@Override
	public void getConfig() {
		// TODO Auto-generated method stub
		Type type01 = new TypeToken<ConfigBean>() {
		}.getType();

		String apiver = api;
		Map<String, Object> map = new HashMap<String, Object>();
		(new Builder<ConfigBean>())
				.setTypeVerParamsAndReturnClass("BY_Config_app", apiver, map,
						type01)
				.requestListener(
						new BaseSuccessReqListener<ConfigBean>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	/***
	 * 绑定手机或者修改绑定手机
	 */
	@Override
	public void bindPhone(String uid, String phone, String code,
			String password, boolean isChange) {
		// TODO Auto-generated method stub
		Type type01 = new TypeToken<String>() {
		}.getType();

		String apiver = api;
		String typeKey = "";
		if (isChange) {
			typeKey = "BY_User_bind";
		} else {
			typeKey = "BY_User_changePhone";
		}
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("mobile", phone);
		map.put("code", code);
		map.put("password", password);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(typeKey, apiver, map, type01)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	/**
	 * 密码修改
	 */
	@Override
	public void updatePwdByPwd(String uid, String oldPassword,
			String newPassword) {
		// TODO Auto-generated method stub
		Type type01 = new TypeToken<String>() {
		}.getType();

		String apiver = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("old_psw", oldPassword);
		map.put("psw", newPassword);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(UpdatePwdByPwd, apiver, map,
						type01)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	/**
	 * 手机找密
	 */
	@Override
	public void updatePwdByPhone(String uid, String mobile, String code,
			String newPassword) {
		// TODO Auto-generated method stub
		Type type01 = new TypeToken<String>() {
		}.getType();

		String apiver = api;
		Map<String, Object> map = new HashMap<String, Object>();
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(FindPwdByPhone, apiver, map,
						type01)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	/***
	 * 获取系统消息
	 */
	@Override
	public void systemMessage(String uid, String msgType) {
		// TODO Auto-generated method stub
		Type type01 = new TypeToken<String>() {
		}.getType();

		String apiver = api;
		Map<String, Object> map = new HashMap<String, Object>();
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(systemMessage, apiver, map,
						type01)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void getDirection() {
		// TODO Auto-generated method stub
		Type type01 = new TypeToken<String>() {
		}.getType();

		String apiver = api;
		Map<String, Object> map = new HashMap<String, Object>();
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(oritation, apiver, map, type01)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	/**
	 * 发布房源
	 */
	public void getHouseAdd(String uid, String imgs, String community_code,
			int rent_type, String contact_name, String contact_phone,
			String rent, String size, String unit, String house_floor,
			String floors, String house_decoration, String house_pay,
			String house_dir, String address, String entrust_money,
			String house_feature, String house_device, String addressdetail,
			String house_no, String deposit,String abstracts,String title) {
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("imgs", imgs);
		map.put("community_code", community_code);
		map.put("rent_type", rent_type);
		map.put("contact_name", contact_name);
		map.put("contact_phone", contact_phone);
		map.put("rent", rent);
		map.put("size", size);
		map.put("unit", unit);
		map.put("house_floor", house_floor);
		map.put("floors", floors);
		map.put("house_decoration", house_decoration);
		map.put("house_pay", house_pay);
		map.put("house_dir", house_dir);
		map.put("address", address);
		map.put("entrust_money", entrust_money);
		map.put("house_feature", house_feature);
		map.put("house_device", house_device);
		map.put("house_no", house_no);
		map.put("deposit", deposit);
		map.put("abstract", abstracts);
		map.put("title", title);

		Log.d("map==",map.toString());
		// map.put("address", addressdetail);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(house_addKey, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

	/**
	 * 实名认证
	 */
	public void getRealName(String uid, String realname, String idnumber,
			String bank_no, String bank_phone, String code) {
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("realname", realname);
		map.put("idnumber", idnumber);
		map.put("bank_no", bank_no);
		map.put("bank_phone", bank_phone);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(renzhengKey, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

	/**
	 * 消息分页查询
	 */
	@Override
	public void getSystemMess(String uid, String msg_type, String page_no,
			String page_size) {

		Type type = new TypeToken<SystemMessBean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("msg_type", msg_type);
		map.put("page_no", page_no);
		map.put("page_size", page_size);

		(new Builder<SystemMessBean>())
				.setTypeVerParamsAndReturnClass(messageKey, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<SystemMessBean>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

	@Override
	public void bindKeJiXia(String uid, boolean isBind) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		// map.put("name", name);
		// map.put("pass", pass);
//		if (!isBind) {
//			bindKeJiXia = "BY_Sciener_unbind";
//		}
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(bindKeJiXia, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

	@Override
	public void myKey(String uid,String kword) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<List<KeysBean>>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("kword", kword);
		(new Builder<List<KeysBean>>())
				.setTypeVerParamsAndReturnClass(myKey, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<List<KeysBean>>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void updateKey(String uid, String lockId, String alias) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("lock_id", lockId);
		map.put("alias", alias);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(updateKey, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void heTongParams(String subject, String contract_no) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<List<HeTongBean>>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("subject", subject);
		map.put("contract_no", contract_no);
		(new Builder<List<HeTongBean>>())
				.setTypeVerParamsAndReturnClass(heTongParams, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<List<HeTongBean>>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void tiJiaoHeTong(String uid, String contractNo, String params) {
		// TODO Auto-generated method stub

		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("contract_no", contractNo);
		map.put("params", params);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(tiJiaoHeTong, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void wanChengHeTong(String uid, String contractNo) {
		// TODO Auto-generated method stub

		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("contract_no", contractNo);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(queRenHeTong, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void qianyueDetail(String uid, String contractNo) {
		// TODO Auto-generated orderDetail

		Type type = new TypeToken<QianYueDetailBean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("contract_no", contractNo);
		(new Builder<QianYueDetailBean>())
				.setTypeVerParamsAndReturnClass(orderDetail, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<QianYueDetailBean>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void myCollection(String uid, String status) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<List<MyCollectionBean>>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("status", status);
		(new Builder<List<MyCollectionBean>>())
				.setTypeVerParamsAndReturnClass(myCollection, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<List<MyCollectionBean>>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

	@Override
	public void getYWContactName(String uid, String startDate, String endDate) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<List<MyCollectionBean>>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("begin", startDate);
		map.put("end", endDate);
		(new Builder<List<MyCollectionBean>>())
				.setTypeVerParamsAndReturnClass(ywContactName, apiVer, map,
						type)
				.requestListener(
						new BaseSuccessReqListener<List<MyCollectionBean>>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void siLiao(String uid, String toUid, String msg) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<List<MyCollectionBean>>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("to_uid", toUid);
		map.put("msg", msg);
		(new Builder<List<MyCollectionBean>>())
				.setTypeVerParamsAndReturnClass(siliao, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<List<MyCollectionBean>>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void getSiXinHistory(String uid, String toUid, String begin,
			String end, String count, String next) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<List<MyCollectionBean>>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("to_uid", toUid);
		map.put("begin", begin);
		map.put("end", end);
		map.put("count", count);
		map.put("next", next);

		(new Builder<List<MyCollectionBean>>())
				.setTypeVerParamsAndReturnClass(getYwHistory, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<List<MyCollectionBean>>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void payHouse(String uid, String pay_code_type, String items,
			String pay_type, String wallet_pay_money, String money,
			String wallet_only) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<PayInfo>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("pay_code_type", pay_code_type);
		map.put("items", items);// 订单编号
		map.put("pay_type", pay_type);// 余额,int,分, - (传0,暂未实现)//
										// 第三方支付方式，int,[0=>无第三方(todo),1=>支付宝，2=>微信(todo)，3=>融丰(todo)]
		map.put("wallet_pay_money", wallet_pay_money);
		map.put("wallet_only", wallet_only);
		map.put("amount", money);

		(new Builder<PayInfo>())
				.setTypeVerParamsAndReturnClass(payHouse, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<PayInfo>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void sendKey(String uid, String toUid,String lockId,String start,
			String end, String mark,String send_type) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		boolean islock= (boolean) SPUtils.get(MyApplcation.ctx,null, SPContants.ISLOCK,false);

		if (islock){
			map.put("sid", uid);
		}else {
			map.put("uid", uid);
		}
		map.put("to_mobile", toUid);//
		map.put("lock_id", lockId);//
		map.put("start", start);//
		map.put("end", end);
		map.put("mark", mark);
		map.put("send_type",send_type);
		if (islock){
			(new Builder<String>(islock))
					.setTypeVerParamsAndReturnClass(sendKey, apiVer, map, type)
					.requestListener(
							new BaseSuccessReqListener<String>(getListener(),islock))
					.errorListener(new BaseErrorListener(getListener()))
					.desEncodeThenBuildAndSend();

		}else {
			(new Builder<String>())
					.setTypeVerParamsAndReturnClass(sendKey, apiVer, map, type)
					.requestListener(
							new BaseSuccessReqListener<String>(getListener(),islock))
					.errorListener(new BaseErrorListener(getListener()))
					.desEncodeThenBuildAndSend();
		}

	}

	@Override
	public void sendPwd(String uid, String toUid, String lockId, String start,
			String end) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<PayInfo>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("to_uid", toUid);//
		map.put("lock_id", lockId);//
		map.put("start", start);//
		map.put("end", end);
		(new Builder<PayInfo>())
				.setTypeVerParamsAndReturnClass(sendPwd, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<PayInfo>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void keisuojilu(String uid, String lockId, String page,
			String pageSize) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<List<KaiSuoJiLu>>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("lock_id", lockId);//
		map.put("page", page);//
		map.put("pageSize", pageSize);
		(new Builder<List<KaiSuoJiLu>>())
				.setTypeVerParamsAndReturnClass(kaiSuoJiLu, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<List<KaiSuoJiLu>>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void keyOfLock(String uid, String lockId) {
		// TODO Auto-generated method stub

		Type type = new TypeToken<KeyOfLockBean>() {
		}.getType();
		String apiVer = api;
		boolean lock= (boolean) SPUtils.get(MyApplcation.ctx,null,SPContants.ISLOCK,false);
		Map<String, Object> map = new HashMap<String, Object>();
		if (lock){
			map.put("sid", uid);
		}else {
			map.put("uid", uid);
		}
		map.put("lock_id", lockId);
		if (lock){
			(new Builder<KeyOfLockBean>(lock))
					.setTypeVerParamsAndReturnClass(keyOfLock, apiVer, map, type)
					.requestListener(
							new BaseSuccessReqListener<KeyOfLockBean>(
									getListener(),lock))
					.errorListener(new BaseErrorListener(getListener()))
					.desEncodeThenBuildAndSend();
		}else {
			(new Builder<KeyOfLockBean>())
					.setTypeVerParamsAndReturnClass(keyOfLock, apiVer, map, type)
					.requestListener(
							new BaseSuccessReqListener<KeyOfLockBean>(
									getListener()))
					.errorListener(new BaseErrorListener(getListener()))
					.desEncodeThenBuildAndSend();
		}

	}

	@Override
	public void passJiLu(String uid, String lock_id, String current_page, String per_page) {
		Type type = new TypeToken<GuanLiPassBean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
        boolean lock= (boolean) SPUtils.get(MyApplcation.ctx,null,SPContants.ISLOCK,false);
        if (lock){
            map.put("sid", uid);
        }else {
            map.put("uid", uid);
        }

		map.put("lock_id", lock_id);
		map.put("current_page", current_page);
		map.put("per_page", per_page);

		if (lock){
            (new Builder<GuanLiPassBean>(lock))
                    .setTypeVerParamsAndReturnClass(passJiLu, apiVer, map, type)
                    .requestListener(
                            new BaseSuccessReqListener<GuanLiPassBean>(
                                    getListener(),lock))
                    .errorListener(new BaseErrorListener(getListener()))
                    .desEncodeThenBuildAndSend();
        }else {
            (new Builder<GuanLiPassBean>())
                    .setTypeVerParamsAndReturnClass(passJiLu, apiVer, map, type)
                    .requestListener(
                            new BaseSuccessReqListener<GuanLiPassBean>(
                                    getListener()))
                    .errorListener(new BaseErrorListener(getListener()))
                    .desEncodeThenBuildAndSend();
        }

	}

	@Override
	public void chongZhi(String uid, String lock_id) {
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("lock_id", lock_id);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(deletePass, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void deleteKey(String uid, String toUid, String keyId, String lockId) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("lock_id", lockId);
		map.put("to_uid", toUid);
		map.put("key_id", keyId);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(deleteKey, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void unbindLock(String uid, String lockId, String key_id,String auth_out) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		boolean islock= (boolean) SPUtils.get(MyApplcation.ctx,null,SPContants.ISLOCK,false);
		if (islock){
			map.put("sid", uid);
		}else {
			map.put("uid", uid);
		}
		map.put("lock_id", lockId);
		map.put("key_id", key_id);
		map.put("auth_out", auth_out);
		if (islock){
			(new Builder<String>(islock))
					.setTypeVerParamsAndReturnClass(unbindAdmin, apiVer, map, type)
					.requestListener(
							new BaseSuccessReqListener<String>(getListener(),islock))
					.errorListener(new BaseErrorListener(getListener()))
					.desEncodeThenBuildAndSend();
		}else {
			(new Builder<String>())
					.setTypeVerParamsAndReturnClass(unbindAdmin, apiVer, map, type)
					.requestListener(
							new BaseSuccessReqListener<String>(getListener()))
					.errorListener(new BaseErrorListener(getListener()))
					.desEncodeThenBuildAndSend();
		}

	}

	@Override
	public void downLoadKey(String uid, String keyId, String lockId) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<DownKeyBean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("lock_id", lockId);
		map.put("key_id", keyId);
		(new Builder<DownKeyBean>())
				.setTypeVerParamsAndReturnClass(downKey, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<DownKeyBean>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void lockKey(String uid, String toUid, String keyId, String lockId,
			int type) {
		// TODO Auto-generated method stub
		Type typeClass = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("lock_id", lockId);
		map.put("to_uid", toUid);
		map.put("key_id", keyId);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(
						type == 0 ? unlockKey : lockKey, apiVer, map, typeClass)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	/**
	 * 修改支付密码
	 */
	@Override
	public void updataZhiFu(String uid, String old_psw, String new_psw) {
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("old_psw", old_psw);
		map.put("new_psw", new_psw);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(zhiFuPass, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

	/**
	 * 支付密码验证
	 */
	@Override
	public void ZhiFuPassYanZheng(String uid, String psw) {
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("psw", psw);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(zhiFuPassYanZheng, apiVer, map,
						type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

	@Override
	public void shouquan(String uid, String toUid, String lockId, String keyId,
			String startDate, String endDate) {
		// TODO Auto-generated method stub

		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("to_uid", toUid);
		map.put("lock_id", lockId);
		map.put("auth", keyId);
		map.put("start", startDate);
		map.put("end", endDate);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(shouquan, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	/**
	 * 上传开锁记录
     */
	@Override
	public void uploadHistoryOfUnlock(String uid, String lockId,String records, String success,long unlock_time,int power) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		boolean lock= (boolean) SPUtils.get(MyApplcation.ctx,null,SPContants.ISLOCK,false);
        if (lock){
			map.put("sid", uid);
		}else {
			map.put("uid", uid);
		}
		map.put("lock_id", lockId);
		map.put("records", records);
		map.put("success", success);
        map.put("unlock_time",unlock_time);
        map.put("power",power);
        if (lock){
			(new Builder<String>(lock))
					.setTypeVerParamsAndReturnClass(uploadJiLu, apiVer, map, type)
					.requestListener(
							new BaseSuccessReqListener<String>(getListener(),lock))
					.errorListener(new BaseErrorListener(getListener()))
					.desEncodeThenBuildAndSend();
		}else {
			(new Builder<String>())
					.setTypeVerParamsAndReturnClass(uploadJiLu, apiVer, map, type)
					.requestListener(
							new BaseSuccessReqListener<String>(getListener()))
					.errorListener(new BaseErrorListener(getListener()))
					.desEncodeThenBuildAndSend();
		}

	}

	/**
	 * 电量过低
	 * @param uid
	 * @param lock_id
	 * @param power
     */
	@Override
	public void updateDianLiang(String uid, String lock_id, String power) {
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("lock_id", lock_id);
		map.put("power", power);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(uploadDian, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void myWallet(String uid) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<MyWalletBean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		(new Builder<MyWalletBean>())
				.setTypeVerParamsAndReturnClass(myWallet, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<MyWalletBean>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void updateWalletPsw(String uid, String oldPsw, String newPsw) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<MyWalletBean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("old_psw", oldPsw);
		map.put("new_psw", newPsw);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(updateWalletPws, apiVer, map,
						type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void yzWalletPsw(String uid, String psw) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("psw", psw);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(walletCheckPsw, apiVer, map,
						type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void bindBankCard(String uid, String bank_no, String bank_account,
			String bank_cert, String bank_phone, String bank_cvv,
			String bank_yxq,String bank_deposit) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("bank_no", bank_no);
		map.put("bank_account", bank_account);
		map.put("bank_cert", bank_cert);
		map.put("bank_phone", bank_phone);
		map.put("bank_cvv", bank_cvv);
		map.put("bank_yxq", bank_yxq);
		map.put("bank_deposit", bank_deposit);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(WalletBindBankCard, apiVer,
						map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

	@Override
	public void getBankType(String bankNo) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<ArrayList<String>>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("bank_no", bankNo);
		(new Builder<ArrayList<String>>())
				.setTypeVerParamsAndReturnClass(bankType, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<ArrayList<String>>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void bankList(String uid) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<ArrayList<BindCardsList>>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		(new Builder<ArrayList<BindCardsList>>())
				.setTypeVerParamsAndReturnClass(bankList, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<ArrayList<BindCardsList>>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void unbindBankCard(String uid, String bankNo) {
		// TODO Auto-generated method stub

		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("bank_no", bankNo);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(WalletUnBindBankCard, apiVer,
						map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void tixian(String uid, String money, String cardNo) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("account_id", cardNo);
		map.put("money", money);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(tixian, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void rfPay(String uid, String pay_code, String bank_id) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<RongFengsBean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("pay_code", pay_code);
		map.put("bank_id", bank_id);
		(new Builder<RongFengsBean>())
				.setTypeVerParamsAndReturnClass(by_pay_rfpay, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<RongFengsBean>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

	@Override
	public void rongfengPay(String uid, String pay_code, String bank_id) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<RongFengsBean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("pay_code", pay_code);
		map.put("bank_id", bank_id);
		(new Builder<RongFengsBean>())
				.setTypeVerParamsAndReturnClass(by_pay_rfpay, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<RongFengsBean>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void lunbo(String position) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<List<LunBoBean>>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("position", position);
		(new Builder<List<LunBoBean>>())
				.setTypeVerParamsAndReturnClass(lunbo, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<List<LunBoBean>>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void sendRf(Object orderCode, String code) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("order_no", orderCode);
		map.put("sms_code", code);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(yanzhengrf, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void yueYanzheng(String uid, String password) {
		// TODO Auto-generated method stub

		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("psw", password);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(yzyue, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void safety(String uid, String pay_code, String bank_id) {
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("pay_code", pay_code);
		map.put("bank_id", bank_id);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(safetyPay, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void zoushi(String community_id, String chart_type, String which,
			String house_room) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<ZouShiBean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("community_id", community_id);
		map.put("chart_type", chart_type);
		map.put("which", which);
		map.put("house_room", house_room);
		(new Builder<ZouShiBean>())
				.setTypeVerParamsAndReturnClass(zoushi, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<ZouShiBean>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void queryUserByPhone(String phone) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<PersonDataBean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("mobile", phone);
		(new Builder<PersonDataBean>())
				.setTypeVerParamsAndReturnClass(queryUserByPhone, apiVer, map,
						type)
				.requestListener(
						new BaseSuccessReqListener<PersonDataBean>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void zhuanzhang(String uid, String to_account, String balance,String contractNo,
			String trans_type) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("to_account", to_account);
		map.put("balance", balance);
		map.put("trans_type", trans_type);
		if(contractNo.equals("")){

		}else {
			map.put("extra", contractNo);
		}
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(zhuanzhang, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void getPersonData(String uid) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<PersonDataBean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		(new Builder<PersonDataBean>())
				.setTypeVerParamsAndReturnClass(personData, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<PersonDataBean>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void getOpenId(String uid) {
		Type type = new TypeToken<OpenIdBean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		(new Builder<OpenIdBean>())
				.setTypeVerParamsAndReturnClass(openid, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<OpenIdBean>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void querenZichan(String uid, String contract_no,String dissent) {
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("contract_no", contract_no);
		map.put("dissent",dissent);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(qingdan, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void zhiMa(String uid) {
		Type type = new TypeToken<ZhiMaBean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		(new Builder<ZhiMaBean>())
				.setTypeVerParamsAndReturnClass(zhima_xinyong, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<ZhiMaBean>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void zhiMaChaXun(String uid, String biz_no) {
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("biz_no", biz_no);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(zhima_xinyong_save, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void loginByNewDevice(String uid, String device_token, String device_name) {
		Type type = new TypeToken<NewDeviceLoginBean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("device_token", device_token);
		map.put("device_name", device_name);
		(new Builder<NewDeviceLoginBean>())
				.setTypeVerParamsAndReturnClass(loginByNewDevice, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<NewDeviceLoginBean>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

	@Override
	public void verifyBySms(String mobile, String code) {
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("mobile", mobile);
		map.put("code", code);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(verifyBySms, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

	@Override
	public void rentingBill(String uid, int per_page, int current_page) {
		Type type = new TypeToken<RentingBillBean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("per_page", per_page);
		map.put("current_page", current_page);
		(new Builder<RentingBillBean>())
				.setTypeVerParamsAndReturnClass(rentingbill, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<RentingBillBean>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void agentCenter(String uid) {
		Type type = new TypeToken<AgentCenterBean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		(new Builder<AgentCenterBean>())
				.setTypeVerParamsAndReturnClass(agent_center, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<AgentCenterBean>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void applyStage(String uid, String contract_no) {
		Type type = new TypeToken<ApplyStageBean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("contract_no",contract_no);
		//test 1 为测试 2 为正式
//		map.put("test",1);
		map.put("test",2);
		(new Builder<ApplyStageBean>())
				.setTypeVerParamsAndReturnClass(apply_stage, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<ApplyStageBean>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void icCardList(String uid, String lock_id, String page, String size,String remote) {
		Type type = new TypeToken<ICCardListBean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("lock_id",lock_id);
		map.put("page",page);
		map.put("size",size);
		map.put("remote",remote);
		(new Builder<ICCardListBean>())
				.setTypeVerParamsAndReturnClass(icList, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<ICCardListBean>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void addIcCard(String uid, String lock_id, String card_no,String card_name,String start,String end) {
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("lock_id",lock_id);
		map.put("card_no",card_no);
		map.put("card_name", card_name);
		map.put("start",start);
		map.put("end",end);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(addICCard, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

	@Override
	public void deleteIcCard(String uid, String lock_id, String cardId) {

		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("lock_id",lock_id);
		map.put("cardId",cardId);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(deleteICCard, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void clearIcCardList(String uid, String lock_id) {

		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("lock_id",lock_id);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(clearICCardList, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void changeAdministrator(String uid, String lock_id, String to_mobile) {

		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", uid);
		map.put("lock_id",lock_id);
		map.put("to_mobile",to_mobile);
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(changeAdminator, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<String>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

}
